package com.lsz.intelligentflowerwatering.ui

import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Help
import androidx.compose.runtime.Composable
import com.lsz.intelligentflowerwatering.ui.theme.MyComposeTheme

@Composable
fun MyTopAppBar (title:String,count:Int,back:()->Unit){
    TopAppBar(
        title = { Text(text = title) },
        navigationIcon = {
            if (count != 0) {
                IconButton(onClick = back) {
                    Icon(Icons.Filled.ArrowBack, "")
                }
            }
        },
        actions = {
            IconButton(onClick = { }) {
                Icon(Icons.Filled.Help, "")
            }
        },
        backgroundColor = MyComposeTheme.colors.toolbarBackground,
        contentColor = MyComposeTheme.colors.toolbarContent
    )
}